package com.an.blog.service;

import com.an.blog.admin.domain.bo.BlogArticleBo;
import com.an.blog.admin.domain.vo.BlogArticleVo;
import com.an.blog.web.domain.bo.BlogArticleWebBo;
import com.an.blog.web.domain.vo.ArchiveGroupYearWebVo;
import com.an.blog.web.domain.vo.BlogArticleDetailWebVo;
import com.an.blog.web.domain.vo.BlogArticleWebVo;
import com.an.common.core.domain.PageQuery;
import com.an.common.core.page.TableDataInfo;

import java.util.Collection;
import java.util.List;

/**
 * 博客文章Service接口
 *
 * @author Ann
 * @date 2023-05-08
 */
public interface IBlogArticleService {

    /**
     * 查询博客文章
     *
     * @param articleId 文章id
     * @return {@link BlogArticleVo }
     * @author: Ann
     * @createDate: 2023/05/09 11:39:19
     * @version: 1.0.0
     */
    BlogArticleVo queryById(Long articleId);

    /**
     * 查询博客文章列表
     *
     * @param bo        业务对象
     * @param pageQuery 页面查询
     * @return {@link TableDataInfo }<{@link BlogArticleVo }>
     * @author: Ann
     * @createDate: 2023/05/09 11:39:21
     * @version: 1.0.0
     */
    TableDataInfo<BlogArticleVo> queryPageList(BlogArticleBo bo, PageQuery pageQuery);


    /**
     * 新增博客文章
     *
     * @param bo 业务对象
     * @return {@link Boolean }
     * @author: Ann
     * @createDate: 2023/05/09 11:39:16
     * @version: 1.0.0
     */
    Boolean insertByBo(BlogArticleBo bo);

    /**
     * 修改博客文章
     *
     * @param bo 业务对象
     * @return {@link Boolean }
     * @author: Ann
     * @createDate: 2023/05/09 11:39:33
     * @version: 1.0.0
     */
    Boolean updateByBo(BlogArticleBo bo);

    /**
     * 校验并批量删除博客文章信息
     *
     * @param ids     id
     * @param isValid 是有效
     * @return {@link Boolean }
     * @author: Ann
     * @createDate: 2023/05/09 11:39:32
     * @version: 1.0.0
     */
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

    /**
     * 更新文章状态
     *
     * @param bo 业务对象
     * @return int
     * @author: Ann
     * @createDate: 2023/05/09 16:47:50
     * @version: 1.0.0
     */
    int updateArticleStatus(BlogArticleBo bo);

    /**
     * 更新文章是顶级
     *
     * @param bo 业务对象
     * @return int
     * @author: Ann
     * @createDate: 2023/05/09 16:50:11
     * @version: 1.0.0
     */
    int updateArticleIsTop(BlogArticleBo bo);

    /**
     * 查询页面列表
     *
     * @param articleWebBo 文章网络业务对象
     * @param pageQuery    页面查询
     * @return {@link TableDataInfo }<{@link BlogArticleWebVo }>
     * @author: Ann
     * @createDate: 2023/05/26 16:34:18
     * @version: 1.0.0
     */
    TableDataInfo<BlogArticleWebVo> queryWebPageList(BlogArticleWebBo articleWebBo, PageQuery pageQuery);

    /**
     * 喜欢文章
     *
     * @param articleId 文章id
     * @return boolean
     * @author: Ann
     * @createDate: 2023/06/07 14:00:43
     * @version: 1.0.0
     */
    Boolean likeArticle(Long articleId);

    /**
     * 查询网站文章id
     *
     * @param articleId 文章id
     * @return {@link BlogArticleDetailWebVo }
     * @author: Ann
     * @createDate: 2023/06/07 18:43:25
     * @version: 1.0.0
     */
    BlogArticleDetailWebVo queryWebArticleById(Long articleId);



    /**
     * 查询web归档列表
     *
     * @return {@link List }<{@link ArchiveGroupYearWebVo }>
     * @author: Ann
     * @createDate: 2023/11/30 10:52:49
     * @version: 1.0.0
     */
    List<ArchiveGroupYearWebVo> queryWebArchiveList();

    /**
     * 查询关于我文章
     *
     * @return {@link BlogArticleDetailWebVo }
     * @author Ann
     * @date 2024/06/05
     */
    BlogArticleDetailWebVo queryAboutMeArticle();

    /**
     * 初始化 ES 索引
     *
     * @return {@link Boolean }
     * @author Ann
     * @date 2024/06/05
     */
    Boolean initEsIndex();

    /**
     * 查看文章
     *
     * @param articleId 文章编号
     * @return {@link Boolean }
     * @author Ann
     * @date 2024/06/16
     */
    Boolean viewArticle(Long articleId);
}
